<?php
namespace app\admin\controller;

use think\Controller;
use app\admin\service\UserService;
class User extends Controller
{
    private $userService;

    /**
     * 依赖注入 Service
     *
     * @param UserService $userService
     * @author zws
     */
    public function __construct(UserService $userService)
    {
        $this->userService = $userService;
        parent::__construct();
    }

    /**
     * 检测人员列表
     * @return \think\response\Json
     * @author zws
     */
    public function userList()
    {
        $input = $this->request->input;
        $result = $this->userService->userList($input);
        return app_response(200, $result);
    }

    /**
     * 获取单个用户信息
     * @return \think\response\Json
     * @author zws
     */

    public function editUser(){
        $input = $this->request->input;
        $result = $this->userService->editUser($input);
        return app_response(200, $result);
    }
    /**
     * 编辑用户信息
     * @return \think\response\Json
     * @author zws
     */
    public function update(){
        $input = $this->request->input;
        $result = $this->userService->update($input);
        return app_response(200, '编辑成功');
    }


}